﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Linq;

namespace Wwtfly.CHY.Model
{


    public class OperateResult
    {

        public OperateResult()
        {
            this.ResultCode = "100";
        }
        /// <summary>
        /// 返回编码.100:成功. -100.操作失败.  -99:出现异常.. 业务错误的: 从-10开始编码. 
        /// </summary>
        public String ResultCode;

        public String getResultCode()
        {
            return ResultCode;
        }

        public void setResultCode(String resultCode)
        {
            ResultCode = resultCode;
        }

        public String getResultHtml()
        {
            return ResultHtml;
        }

        public void setResultHtml(String resultHtml)
        {
            ResultHtml = resultHtml;
        }
        /// <summary>
        /// 返回内容
        /// </summary>
        public String ResultHtml;

        /// <summary>
        /// 返回内容2 备注
        /// </summary>
        public Object ResultObject;

        public Object getResultHtmlRemark()
        {
            return ResultObject;
        }

        public void setResultHtmlRemark(Object resultObject)
        {
            ResultObject = resultObject;
        }

        /// <summary>
        /// 判断 结果.(是不是等于100)
        /// </summary>
        /// <returns></returns>
        public bool GetResult()
        {
            return "100".Equals(ResultCode);
        }

        /// <summary>
        /// 是否存在 指定的code ，多个用逗号隔开
        /// </summary>
        /// <param name="codes"></param>
        /// <returns></returns>
        public bool IsExistsResutlCode(string codes)
        {
            return codes.Split(',').Contains(this.ResultCode);
        }
    }

}
